interface ITeamSpec {
  chefIds: number[]
  recipeIds: number[]
}

export type SortRule = 'MAX_REVENUE' | 'MIN_TIME'

export interface IKitchen {
  teams: ITeamSpec[]
  settings: ISettings
}

/**
 * @recipe 菜谱
 * @efficiency 收益效率（收益/时间）
 * @batchRevenue 计算一组菜谱的总收益
 * @batchTime 计算一组菜谱所需时间
 */
export interface ICookableRecipe {
  recipeId: number
  efficiency: number
  batchRevenue: number
  batchTime: number
}

export interface IChefCookableRecipes {
  chefId: number
  cookable: ICookableRecipe[]
}

export interface IBestCombResult {
  totalRevenue: number
  workingTime: number
  combination: IChefCookableRecipes[]
}

/**
 * worker 输入信息
 * @type 类型
 * @chefCombinations 厨师组合(包含菜谱信息)
 * @operatingTime 营业时间
 */
export interface IWorkerInputMessage {
  type: 'start'
  chefCombinations: IChefCookableRecipes[][]
  settings: ISettings
}

interface WorkerOutputEnd {
  type: 'end'
  bestCombResult: IBestCombResult
}

interface WorkerOutputProgress {
  type: 'progress'
  progressStep: number
}

/**
 * worker 输出信息
 * @type 类型
 */
export type IWorkerOutputMessage = WorkerOutputEnd | WorkerOutputProgress

/**
 * @techniques 技法倍数
 */
export interface ISettings {
  sortRule: SortRule
  threads: number
  operatingTime: number
  maxChefCount: number
  maxRecipeCount: number
  techniques: number
}
